package mhe.mgt;

import mhe.mgt.detail.DetailForm;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.ui.ISharedImages;


public class DeleteItemAction extends Action {
	
	public DeleteItemAction(String label) {
        setText(label);
        // The id is used to refer to the action in a menu or toolbar
		setId(ICommandIds.CMD_DELETE_ITEM);
        // Associate the action with a pre-defined command, to allow key bindings.
		setActionDefinitionId(ICommandIds.CMD_DELETE_ITEM);
		setImageDescriptor(new ImageDescriptor() {
			
			@Override
			public ImageData getImageData() {
				return Application.getImage(ISharedImages.IMG_ETOOL_DELETE).getImageData();
			}
		});
	}
	
	public void run() {
		DetailForm.instance.deleteItem();
	}
}
